package de.project.resistor;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.TextView;

public class ColorTextView extends TextView {
	
	public ColorTextView(Context context) {
		super(context);
}

public ColorTextView(Context context, AttributeSet attrs) {
	super(context, attrs);
}

@Override
public void onDraw(Canvas canvas) {
	Paint paint = new Paint();
	paint.setColor(Color.parseColor(getText().toString()));

	canvas.drawRoundRect(new RectF(0, 0, getWidth(), getHeight()), 5, 5, paint);
	}
}